﻿using Newtonsoft.Json;
using System;

namespace Ymatou.API.Common
{

    /// <summary>
    /// 所有请求request的基类
    /// </summary>
    public abstract class IRequest
    {
        /// <summary>
        /// http 请求模式,默认get
        /// </summary>
        [JsonIgnore]
        public virtual bool HttpGet
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        /// 默认请求的 controler地址
        /// </summary>
        [JsonIgnore]
        public abstract string ApiName
        {
            get;
        }

        /// <summary>
        /// 服务地址, 一般为http://域名
        /// </summary>
        [JsonIgnore]
        public virtual string ServiceUrl
        {
            get;
            set;
        }

        /// <summary>
        /// 基本参数验证
        /// </summary>
        public virtual void Validate()
        {

        }
    }

}
